package rma.flp;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class InMemPictureRepository implements PictureRepository {

	Map<Long,Picture> db = new HashMap<Long, Picture>(); 
	
	public Picture load(Long id) {
		return db.get(id);
	}

	public void store(Picture picture) {
		db.put(picture.getId(), picture);
	}

	public void delete(Long id) {
		db.remove(id);
	}

	public List<Picture> findByOwnerEmail(String ownerEmail) {
		return new ArrayList<Picture>(db.values());
	}

}
